class StrTools:
    def __init__(self, string):
        self.string = string

    def reverse(self):
        # str_list = []
        # for char in self.string:
        #     str_list.append(char)
        str_list = list(self.string)  # 字符串可以直接直接转列表
        str_list.reverse()
        return ''.join(str_list)

    # 更简单的实现方法
    def reverse2(self):
        return self.string[::-1]


my_str = StrTools("qwer")
print(my_str.reverse())
